package com.youxin.busfoundation.enums;

import com.youxin.foundation.utils.StringUtils;

/**
 * 登陆平台
 * @author yingde.cao
 *
 */
public enum LoginDeviceType {	
	PC(1),
	Mobile(2),
	Pad(3)
	;
	
	public int getValue() {
		return value;
	}
	
	private int value;
	private LoginDeviceType(int value) {
		this.value = value;
	}
	
	public static LoginDeviceType valueOf(int val)
	{			
		for(LoginDeviceType m : LoginDeviceType.values()) 
		{
			if(val==m.getValue())
				return m;
	    }
		return null;
	}
	
	public static LoginDeviceType nameOf(String val)
	{			
		if(StringUtils.isNullOrEmpty(val))
		{
			return null;
		}
		for(LoginDeviceType m : LoginDeviceType.values()) 
		{
			if(val.equalsIgnoreCase(m.name()))
				return m;
	    }
		return null;
	}
	
}
